package com.cml.rpc.loadbalance;

import java.util.List;

/**
 * @author cml
 * @create 2021/7/22 12:56
 */
public class RoundLoadBalance implements LoadBalance{
    private int index = -1;
    @Override
    public String loadBalance(List<String> addressList) {
        index++;
        index = index % addressList.size();
        System.out.println("轮询负载均衡：" + addressList.get(index) + "服务器");
        return addressList.get(index);
    }
}
